<script>
import { addhealthy } from '@/api/healthy'
import { ElMessage } from 'element-plus'
import {ArrowLeftBold}from  "@element-plus/icons-vue"
export default{
    data() {
        return {
            from:{
                regio:'',
                 group:[],
                 time1:'',
                 time2:'',
                 descl:'',
                //  Type:'张天',
                //  Uploader:'张天妈妈',
                //  range:'感冒药,一天吃三次,一次次一颗', 
                //  ddtime:'2022-02-07 17:12',
                //  aheader:'一年级一班',
                //  day:'2022-02-07',
                //  jsr:'王老师',

            },
            list:{
                Type:'张天',
                 Uploader:'张天妈妈',
                 range:'感冒药,一天吃三次,一次次一颗', 
                 ddtime:'2022-02-07 17:12',
                 aheader:'一年级一班',
                 day:'2022-02-07',
                 jsr:'王老师',
            }


        }

    },
    methods: {
       tj(){
        addhealthy(this.list,this.from).then(res=>{
            if(res.code ==200){
                ElMessage.success('添加成功')
            }
            console.log(res)
        })
        this.from ={
                regio:'',
                 group:[],
                 time1:'',
                 time2:'',
                 descl:'',
        }
       },
       tz(){
        this.$router.push('/healthy/healthylist')
       }
},

components:{
    ArrowLeftBold
}


        
    }

</script>
<template>
  <div>
    <h3>发送提醒</h3>
    <div class="box">
        <el-icon @click="tz" class="fh"><ArrowLeftBold /></el-icon>
        <el-row>
    <el-col :span="24"><div class="grid-content ep-bg-purple-dark" />
        <el-form>
        <el-form-item label="接收人:" required>
          <el-select  v-model="from.regio" placeholder="一年级一班">
            <el-option label="一年级一班" value="一年级一班" />
            <el-option label="一年级二班" value="一年级二班" />
          </el-select>
        </el-form-item>
      </el-form>
    </el-col>
  </el-row>
  <el-row>
    <el-col :span="12"><div class="grid-content ep-bg-purple" />
        <el-form-item label="接收老师:"  required>
      <el-checkbox-group v-model="from.group">
        <el-checkbox label="杨老师" name="type" value="杨老师"/>
        <el-checkbox label="李老师" name="type"  value="李老师"/>
      </el-checkbox-group>
    </el-form-item>
    </el-col>
  </el-row>
  <el-row>
    <el-col :span="8"><div class="grid-content ep-bg-purple" />
        <el-form-item label="用药日期:" required>
      <el-col :span="11">
        <el-form-item prop="date1">
          <el-date-picker
          v-model="from.time1"
            type="date"
            label="Pick a date"
            placeholder="Pick a date"
            style="width: 100%"
          />
        </el-form-item>
      </el-col>
      <el-col class="text-center" :span="2">
        <span class="text-gray-500">-</span>
      </el-col>
      <el-col :span="11">
        <el-form-item prop="date2">
          <el-time-picker
           v-model="from.time2"
            label="Pick a time"
            placeholder="Pick a time"
            style="width: 100%"
          />
        </el-form-item>
      </el-col>
    </el-form-item>
    </el-col>
  </el-row>
  <el-row>
    <el-col :span="20"><div class="grid-content ep-bg-purple" />
        <el-form-item label="内容:" required >
      <el-input class="input" v-model="from.descl"  />
    </el-form-item>
    </el-col>
  </el-row>
  <el-row>
    <el-col :span="4" :push="6"><div class="grid-content ep-bg-purple" />
        <el-button type="primary" @click="tj">
        提交
      </el-button></el-col>
  </el-row>
      
    </div>
  </div>
</template>
<style lang="scss" scoped>
.box {
  height: 600px;
  background-color: white;
  margin-top: 10px;
}
.el-row {
  margin-left: 20px;
}
.el-row:last-child {
  margin-bottom: 0;
}
.el-col {
  border-radius: 4px;
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
}
.input{
    width: 400%;
    height: 50px;
}
.fh{
    width: 30px;
    height: 30px;
    background-color: rgb(48, 146, 225);
    margin-left: 20px;
    border-radius: 7px;
    margin-top: 10px;
}
</style>